export default {
  // 方法 默认就要有一个参数state,第二个参数默认是getters,
  powerCounter(state) {
    return state.counter * state.counter
  },
  over20stu(state) {
    return state.students.filter(item => item.age >= 20)
  },
  over20stuLength(state, getters) {
    return getters.over20stu.length
  },
  overAgestu(state) {
    return function (age) {
      return state.students.filter(item => item.age >= age)
    }
  }
}